package com.woniu.cq.mallrocketmq.consumer;

import com.woniu.cq.mallrocketmq.dto.MessageDto;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author Daniel
 * @version 1.0.0
 * @ClassName MyConsumer
 * @Description TODO
 * @createTime 2020年09月23日 18:42:00
 */
@Component
@RocketMQMessageListener(topic = "topic",consumerGroup = "my-consumer",selectorExpression = "tag1",consumeMode = ConsumeMode.ORDERLY)
public class MyConsumer implements RocketMQListener<MessageDto> {


    @Override
    public void onMessage(MessageDto messageDto) {
        System.out.println(messageDto.getBody());
    }
}
